<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2023/4/7
  Time: 14:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>Title</title>
</head>
<body>

<% System.out.println("hell0");%>
<%! int a1 = 12;%>
<%= "helllo.jsp" %>
<% String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    System.out.println(path);
    System.out.println(basePath);
%>

<%pageContext.setAttribute("aaa","bbb");
    System.out.println(pageContext.getAttribute("aaa"));
%>

${3 > 4  && 3 < 4}<br>
<%
    //在域中存储数据
    session.setAttribute("name","李四");
    request.setAttribute("name","张三");
    session.setAttribute("age","23");
    request.setAttribute("str","");
%>
<h3>el获取值</h3>
${requestScope.name}
${sessionScope.age}
${sessionScope.haha}
${name}
${sessionScope.name}

<%
    List list = new ArrayList();
    list.add("aaaa");
    list.add("bbb");
    request.setAttribute("list",list);
    request.setAttribute("number",4);
%>

<c:if test="${number%2==0}">
${number} 为偶数
</c:if>
<c:forEach items="${list}" var="str" varStatus="vs">
    ${vs.index} ${vs.count} ${str}<br>
</c:forEach>

</body>
</html>
